import { PetIslandFightMemberListItemRenderer } from "./PetIslandFightMemberListItemRenderer";
import { SRobIslandFightPet } from "../../../../../Message/Game/SRobIslandFightPet";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
//class PetIslandFightListItemRenderer
    
    export  class PetIslandFightListItemRenderer extends PetIslandFightMemberListItemRenderer
    {
        constructor()
        {
            super();
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            if (typeof arg1 === "srobislandfightpet") 
            {
                this._vo = arg1 as SRobIslandFightPet;
                _name.text = this._vo.playerName;
                _lifeTxt.text = this._vo.life + "/" + this._vo.maxLife;
                _lifeBg.scaleX = this._vo.life / this._vo.maxLife;
            }
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            _lifeTxt.x = 80;
            _lifeTxt.width = 100;
            _lifeTxt.defaultTextFormat = GlobalStyle.setTextFormatAlign(GlobalStyle._textFormat1, flash.text.TextFormatAlign.CENTER);
            return;
        }

        /* internal */ /* var */_vo: SRobIslandFightPet;
    }
